<!DOCTYPE html>
<html>

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
  <title>找回密码 - {$Think.config.basic.site_title}</title>

  <link href="__STATIC__/css/login.css" rel="stylesheet" type="text/css">
  <script type="text/javascript" src="__STATIC__/js/jquery.js"></script>
  <script src="__STATIC__/js/common.js"></script>
  <script src="__STATIC__/js/layer.js"></script>
</head>

<body>
<div class="top">
  <div class="d1">
    <div class="d11" style="background-image: url({$Think.config.basic.site_logo});height: 18px; background-repeat: no-repeat; background-position: 15px 5px;">
      <a href="{:url('index/index')}" class="d7">会分享有收获</a>
    </div>
  </div>
</div>
<div class="pc"></div>
<span class="bg"></span>

<div class="p9">
  <div class="p5"> </div>
  <div class="p6">为用户而变革，越简单越好，越快越好 ！</div>
  <div class="p4">会分享，就会有收获！</div>

  <div class="p1" style="margin-top: 15px;box-shadow: none;">
    <!-- 注册账号 -->
    <div id="reg">
      <span class="main-title">找回密码</span>
      <form onkeydown="if(event.keyCode==13){doReg();return false;}">

        <br>

        <div class="p3 pmob2">
          <input class="input" id="reg_email" type="email" value="" tabindex="3" maxlength="64" placeholder="安全邮箱">
        </div>

        <div class="p3">
          <div class="errorBox">请安全邮箱</div>
        </div>

        <div class="p3"></div>
      </form>

      <div class="p3">
        <input onclick="doForget()" class="btn" type="submit" tabindex="4" value="找回密码">
      </div>

      <div class="p3" style="text-align:left;">
        <a href="{:url('user/login')}">已经找回？点我登录</a>
      </div>

    </div>

    <div class="p3" id="send_succ" style="display: none">
      <h3 style="text-align: center;font-size: 20px;color: #2196f3;">找回密码邮件发送成功<br>请登录邮箱查看</h3>
      <p style="text-align: center;font-size: 14px;color:#afafaf;">如果没收到邮件请查看回收站</p>
    </div>

  </div>

  <script>

    //提交注册
    function doForget()
    {

      var email = $("#reg_email").val();

      var msg = '';

      if(!email){
        $('#reg_email').focus();
        msg = "请输入绑定的安全邮箱";
      }

      if(msg != ''){
        return error(msg);
      }

      //提交注册
      $.ajax({
        type: "post",
        url : "{:url('user/forget')}",
        data: {
          "email":email
        },
        dataType:'json',
        success: function(data){
          if (data.code == 1) {
            ok(data.msg);
          } else {
            error(data.msg);
          }
        },
        error: function (error) {
          layer.alert("API请求失败，请联系客服",{icon:2});
        }
      });
    }

    //成功
    function ok(msg)
    {
      $("#reg").hide();
      $("#send_succ").show();
    }

    //失败
    function error(msg)
    {
      $(".errorBox").html(msg);
      $(".errorBox").show();
    }
  </script>
</div>

<div class="copyright">不得利用云存储发布，存储，传播违法信息</div>
<div class="foot_info"> © 2021 {$Think.config.basic.site_title}    </div>
</body>
</html>